const MobileCommon: any = {
    hidden: false,
}

const common: any = {
    hidden: false,
    disabled: false,
    loading: false,
    cls: '',
}

const commonField: any = {
    ...common,
    fieldLabel: '',
    placeholder: '请输入',
    size: 'default',
    loading: false,
    readonly: false,
    weight: 1,
}

export const Tabs: any = {
    ...common,
    defaultActiveName: 'tab_0',
    tabPosition: 'top',
    stretch: false,
    closable: false,
    type: 'line',
    items: []
}

export const Split: any = {
    ...common,
    defaultSize: 50,
    direction: 'horizontal',
    hiddenSplit: false,
    items: []
}

export const Tab: any = {
    ...common,
    items: []
}

export const MobileButton: any = {
    ...MobileCommon,
    loading: false,
    disabled: false,
    size: 'normal',
    iconCls: undefined,
}

export const Button: any = {
    ...common,
    text: '',
    type: 'default',
    plain: false,
    round: false,
    circle: false,
    link: false,
    loading: false,
    disabled: false,
    size: 'default',
    iconCls: undefined,
}

export const Toolbar: any = {
    ...common,
    justify: "space-around",
    items: []
}

export const Tree: any = {
    ...common,
    defaultExpandAll: false,
    checkStrictly: true,
    checkbox: false,
    data: []
}

export const Cols: any = {
    ...common,
    gutter: 0,
    items: []
}

export const Divider: any = {
    ...common,
    direction: 'horizontal',
    borderStyle: 'solid',
    contentPosition: 'center',
}

export const List: any = {
    ...common,
    pagination: true,
    pageSize: 20,
    autoLoad: false,
    rowNumber: false,    // 序号列
    pageSizeOption: [
        {value: '20',},
        {value: '50',},
        {value: '100',},
        {value: '200',},
        {value: '300',},
        {value: '500',},
        {value: '1000',},
    ]
}
export const Gridcheck: any = {
    ...common,
}
export const Form: any = {
    ...common,
    colsOfRow: 2,
    scrollable: false,
    size: 'default',
    gutter: '',
    labelPosition: 'right',
    inlineMessage: true,
    showMessage: true,
    labelWidth: '',
    validateOnRuleChange: true,
    items: [],
}

export const baseFormItem: any = {
    fieldLabel: '',
    required: false,
    labelWidth: undefined
}

export const Textfield: any = {
    ...commonField,
}
export const Searchfield: any = {
    ...commonField,
    searchText: '检索',
    searchDisabled: false,
}
export const Checkbox: any = {
    ...commonField,
}

export const Staticfield: any = {
    ...commonField,
    text: '',
}

export const Numberfield: any = {
    ...commonField,
}

export const Filefield: any = {
    ...commonField,
}

export const Radiogroup: any = {
    ...commonField,
    border: false
}

export const Combo: any = {
    ...commonField,
    displayField: 'text',
    valueField: 'id',
    data: []
}

export const Combogrid: any = {
    ...commonField,
    allowCustomInput: false,
    widget: undefined,
    param: {},
    lookup: {},
}

export const Datefield: any = {
    ...commonField,
    type: 'date'
}

export const Datetimefield: any = {
    ...commonField,
    type: 'datetime'
}

export const Alert: any = {
    ...common,
    type: '',
    title: '',
    description: undefined,
    showIcon: false,
    center: false,
    closeText: '',
    closable: true,
}

export const Aggrid: any = {
    ...common,
    height: '300px',
    pagination: true,
    pageSize: 50,
    autoLoad: false,
    rowNumber: false,    // 序号列
    pageSizeOption: [
        {value: '20',},
        {value: '50',},
        {value: '100',},
        {value: '200',},
        {value: '300',},
        {value: '500',},
        {value: '1000',},
    ],
    hideFooterToolbar: false, // 隐藏底部按钮
    hideFooterToolbarRefresh: false, // 隐藏底部刷新按钮
    hideFooterToolbarRowCount: false, // 隐藏底部行数统计
    hideFooterToolbarExcelExport: false, // 隐藏底部导出按钮
    hideFooterToolbarFilter: false, // 隐藏底部筛选按钮
}

export const Source: any = {
    ...common,
    language: 'sql',
    readonly: false
}

export const XTypeName: any = {
    button: '按钮',
    combo: '下拉框',
    combogrid: '数据窗口',
    datefield: '日期输入框',
    datetimefield: '日期事件输入框',
    tabs: '选项卡',
    form: '表单',
    textfield: '文本输入框',
    toolbar: '工具条',
    yvgrid: '增强表格',
    gridcolumn: '字段',
}

export const Exprform: any = {
    ...common,
}

export const Dialog: any = {
    title: '对话框',
    width: '50%',
    fullscreen: false,
    isShow: false,
    draggable: true,
    closeOnClickModal: true,
    closeOnPressEscape: true,
    showClose: true,
    modal: true,
    headerReference: '',
    footerReference: '',
}

export const Drawer: any = {
    title: '抽屉',
    size: '50%',
    closeOnClickModal: true,
    closeOnPressEscape: true,
    direction: 'rtl',
    isShow: false,
    showClose: true,
    modal: true,
    headerReference: '',
    footerReference: '',
}

// 定义工具箱分组的顺序和文本
export const ToolboxCategory: any = [
    {name: 'basic', order: 1},
    {name: 'advanced', order: 2},
]